package com.ch5;

/**
 * @author woldier
 * @version 1.0
 * @description TODO
 * @date 2023/5/16 10:48
 **/
public class Bank extends AtomicInteger{
    public void withdraw(int num){
        while (true){
            int value = getValue();
            if(this.inc(value,value+num))
                break;
        }
    }
}
